

function inviteUser(uid, version)
{
	$("#btn_"+uid).html( "<img id='loader' src='../images/ajax-loader2.gif'/>" );
	$.ajax({
		  type: 'POST',
		  url: "inviteuser",
		  data: {userId:uid, userversionForInvitation:version, ajax:true}
		  
	}).success(function(msg) {
		  $("#btn_"+uid).html("<i>Invited</i>");
	});
}

function acceptInvite(uid, version)
{
	$("#btn_"+uid).html( "<img id='loader' src='../images/ajax-loader2.gif'/>" );
	$.ajax({
		  type: 'POST',
		  url : "acceptinvite",
		  data: { userId:uid, userversionForInvitation:version, ajax:true }
		  
	}).success(function(msg) {
		  $("#btn_"+uid).html("<i>Invited</i>");
	});
}

function removeMember(uid, version)
{
	$("#btn_"+uid).html( "<img id='loader' src='../images/ajax-loader2.gif'/>" );
	$.ajax({
		  type: 'POST',
		  url : "removemember",
		  data: { userId:uid, userversionForRemoval:version, ajax:true }
		  
	}).success(function(msg) {
		  $("#btn_"+uid).html("<i>Removed</i>");
	});	
}

function removeGroup(gid, version)
{
	$("#btn_"+gid).html( "<img id='loader' src='../images/ajax-loader2.gif'/>" );
	$.ajax({
		  type: 'POST',
		  url : "removegroup",
		  data: { groupId:gid, groupversionForRemoval:version, ajax:true }
		  
	}).success(function(msg) {
		  $("#btn_"+gid).html("<i>Removed</i>");
	});	
}

function resquestInvite(uid, gid)
{
	$("#btn_"+gid).html( "<img  id='loader' src='../images/ajax-loader2.gif'/>" );
	$.ajax({
		  type: 'POST',
		  url : "requestinvite",
		  data: { userId:uid, groupId:gid, ajax:true }
		  
	}).success(function(msg) {
		  $("#btn_"+gid).html("<i>Invite Resquest sent</i>");
	});	
}